#include <iostream>
#include <list>
#include "Object.h"
#include "Marco.h"

int main(int argc, char* argv[])
{
    CLampFlash* lpLampFlash = new CLampFlash();
    CLampFlashOnCmd* lpLampFlashOnCmd = new CLampFlashOnCmd(lpLampFlash);
    CLampFlashOffCmd* lpLampFlashOffCmd = new CLampFlashOffCmd(lpLampFlash);
    CController* lpController = new CController(lpLampFlashOnCmd);
    lpController->Execute();
    lpController->Undo();

    lpController->SetCommand(lpLampFlashOffCmd);
    lpController->Execute();
    lpController->Undo();

    cout << "------------------------------------------------------------------" << endl;

    CMarcoCmd* lpMarcoCmd = new CMarcoCmd;
    CLampSound* lpLampSound = new CLampSound();
    lpMarcoCmd->Push(lpLampFlashOnCmd);
    lpMarcoCmd->Push(new CLampSoundOnCmd(lpLampSound));
    lpController->SetCommand(lpMarcoCmd);
    lpController->Execute();
    lpController->Undo();

    return 0;
}
